home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / Clock / Sources / Content.h < prev    next >
Encoding:
Text File  |  1996-04-25  |  3.9 KB  |  127 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Content.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef CONTENT_H
  11. #define CONTENT_H
  12.  
  13. // ----- FrameWork Includes -----
  14.  
  15. #ifndef FWCONTNT_H
  16. #include "FWContnt.h"
  17. #endif
  18.  
  19. //========================================================================================
  20. //    Forward Declarations
  21. //========================================================================================
  22.  
  23. class CClockPart;
  24.  
  25. //========================================================================================
  26. //    class CClockContent
  27. //========================================================================================
  28.  
  29. class CClockContent : public FW_CContent
  30. {
  31. //----------------------------------------------------------------------------------------
  32. //    Initialization/Destruction
  33. //
  34.   public:
  35.     FW_DECLARE_AUTO(CClockContent)
  36.     
  37.     CClockContent(Environment* ev, CClockPart* part);
  38.  
  39.     virtual ~CClockContent();
  40.  
  41. //----------------------------------------------------------------------------------------
  42. //    Inherited API
  43. //
  44.   public:
  45.     virtual void        Externalize(Environment* ev,
  46.                                      ODStorageUnit* storageUnit,
  47.                                      FW_EStorageKinds storageKind,
  48.                                      FW_CCloneInfo* cloneInfo);
  49.     virtual FW_Boolean    Internalize(Environment* ev,
  50.                                      ODStorageUnit* storageUnit, 
  51.                                      FW_EStorageKinds storageKind,
  52.                                      FW_CCloneInfo* cloneInfo);
  53.  
  54. //----------------------------------------------------------------------------------------
  55. //    New API
  56. //
  57.     short         GetClockType() const;
  58.     void         SetClockType(short clockType);
  59.  
  60.     FW_Boolean    HasTickSound() const;
  61.     FW_Boolean    HasChimeSound() const;
  62.  
  63.     void        ToggleTickSound();
  64.     void        ToggleChimeSound();
  65.  
  66. //----------------------------------------------------------------------------------------
  67. //    Data Members
  68. //
  69.   private:
  70.     CClockPart*            fClockPart;
  71.  
  72.     //--- part content data
  73.     short                 fClockType;
  74.     FW_Boolean            fHasTickSound;
  75.     FW_Boolean            fHasChimeSound;
  76. };
  77.  
  78. //----------------------------------------------------------------------------------------
  79. // CClockContent::GetClockType
  80. //----------------------------------------------------------------------------------------
  81. inline short CClockContent::GetClockType() const
  82. {
  83.     return fClockType;
  84. }
  85.  
  86. //----------------------------------------------------------------------------------------
  87. // CClockContent::SetClockType
  88. //----------------------------------------------------------------------------------------
  89. inline void CClockContent::SetClockType(short clockType)
  90. {
  91.     fClockType = clockType;
  92. }
  93.  
  94. //----------------------------------------------------------------------------------------
  95. // CClockContent::HasTickSound
  96. //----------------------------------------------------------------------------------------
  97. inline FW_Boolean CClockContent::HasTickSound() const
  98. {
  99.     return fHasTickSound;
  100. }
  101.  
  102. //----------------------------------------------------------------------------------------
  103. // CClockContent::HasChimeSound
  104. //----------------------------------------------------------------------------------------
  105. inline FW_Boolean CClockContent::HasChimeSound() const
  106. {
  107.     return fHasChimeSound;
  108. }
  109.  
  110. //----------------------------------------------------------------------------------------
  111. // CClockContent::ToggleTickSound
  112. //----------------------------------------------------------------------------------------
  113. inline void CClockContent::ToggleTickSound()
  114. {
  115.     fHasTickSound = !fHasTickSound;
  116. }
  117.  
  118. //----------------------------------------------------------------------------------------
  119. // CClockContent::ToggleChimeSound
  120. //----------------------------------------------------------------------------------------
  121. inline void CClockContent::ToggleChimeSound()
  122. {
  123.     fHasChimeSound = !fHasChimeSound;
  124. }
  125.  
  126. #endif
  127.